﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Quexcel.OpenXML.Interfaces;
using Quexcel.OpenXML.Excel.Style;
using System.IO.Packaging;

namespace Quexcel.OpenXML.Excel.Worksheet.Components
{
    public class Row : IRow
    {
        internal List<ICell> Cells;
        private int rowIndex;
        private RowStyle style;
        
        internal Row(int rowIndex, PackagePart sheetPart) 
        {
            this.rowIndex = rowIndex;
        }

        internal ICell NewCell(Address cellAdress, int styleIndex)
        {
            return Cell.CreateCell(cellAdress, styleIndex, this);
        }

        #region IRow Members

        public ICell this[int index]
        {
            get 
            {
                return Cells[index];
            }
        }

        public int RowIndex
        {
            get { return rowIndex; }
        }

        public RowStyle Style
        {
            get
            {
                return style;
            }
            set
            {
                style = value;
            }
        }

        #endregion
    }
}
